package testing.control;

import java.awt.Container;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;

import utilities.control.enums.MouseEventType;
import utilities.control.mouse.Mouse;

public class TestMouseControl extends Mouse 
{
	public TestMouseControl(Container mouseUser)
	{
		super(1, 1, 1, 1, 1, 1, 1, 1, mouseUser);
	}

	public void onMouseEvent(MouseEventType t, MouseEvent e) 
	{
		String event = null;

		if(MouseEventType.MOUSE_CLICKED_EVENT.equals(t))
			event = "Mouse Button Clicked";
		else if(MouseEventType.MOUSE_PRESSED_EVENT.equals(t))
			event = "Mouse Button Pressed";
		else if(MouseEventType.MOUSE_RELEASED_EVENT.equals(t))
			event = "Mouse Button Released";
		else if(MouseEventType.MOUSE_ENTERED_EVENT.equals(t))
			event = "Mouse Entered";
		else if(MouseEventType.MOUSE_EXITED_EVENT.equals(t))
			event = "Mouse Exited";
		else if(MouseEventType.MOUSE_DRAGGED_EVENT.equals(t))
			event = "Mouse Dragged";
		else if(MouseEventType.MOUSE_MOVED_EVENT.equals(t))
			event = "Mouse Moved";
		
		int x = e.getX() - this.getParent().getInsets().left;
		int y = e.getY() - this.getParent().getInsets().top;
		
		System.out.println(event + ": " + "(" + x + ", " + y + ")");
	}

	public void onMouseWheelEvent(MouseWheelEvent e) 
	{
		System.out.println("Mouse Wheel!");
	}
}
